/*
 * @Author: C.
 * @Date: 2021-07-12 09:40:19
 * @LastEditTime: 2021-08-24 13:43:04
 * @Description: file content
 */
import { defHttp } from '/@/utils/http/axios';
// import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel';
import { TestParams,TestResultModel } from "./model/test";

import { ErrorMessageMode } from '/#/axios';

enum Api {
  test = '/SalesBill/SearchSalesBillById',
  Logout = '/logout',
  GetUserInfo = '/getUserInfo',
  GetPermCode = '/getPermCode',
  getClient='/BaseInfo/GetAllClient',
  getTestDetail='/salesbill/GetSalesBillByBillId'
}

/**
 * @description: user login api 登入接口
 * @param {LoginParams} params 登入参数
 * @param {ErrorMessageMode} mode 提示模式
 * @return {*}
 */
export function testApi(params: TestParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<TestResultModel>(
    {
      url: Api.test,
      params,
    },
    {
      errorMessageMode: mode,
    }
  );
}
export function getClient( mode: ErrorMessageMode = 'modal') {
  return defHttp.get<TestResultModel>(
    {
      url: Api.getClient,
    },
    {
      errorMessageMode: mode,
    }
  );
}
export function getTestDetail(params:{BillId:string}, mode: ErrorMessageMode = 'modal') {
  return defHttp.get<TestResultModel>(
    {
      url: Api.getTestDetail,
      params
    },
    {
      errorMessageMode: mode,
    }
  );
}